(function ($){
    Drupal.behaviors.programlist = {
        attach: function(context, settings) {
            $('#edit-degree').change(function(){
                for(j = 1; j <= 15; ++j){
                    $('#edit-list-column-'+j).attr('checked', false);
                }
                
            });
            $('#edit-list-column-0').attr('disabled', true);
            $('#edit-list-column-0').attr('checked', true);
            $('#edit-list-column-4').hide();
            $("label[for='edit-list-column-4']").hide();
            $('#edit-list-column-5').hide();
            $("label[for='edit-list-column-5']").hide();
            for (i = 3; i <= 15;++i){
                $('#tableresult td:nth-child('+i+'),th:nth-child('+i+')').hide();
            }
             $('#tableresult td:nth-child(7),th:nth-child(7)').show();             
            for(j = 1; j <= 15; ++j){
                $('#edit-list-column-'+j).click(function(){
                    var my_id = $(this).attr('id');
                    var length = my_id.length;
                    var id_num = my_id.substring(17, length);
                    var k = parseInt(id_num, 10) + 2;
                                      
                    if (this.checked){
                        $('#tableresult td:nth-child('+ k +'),th:nth-child('+ k + ')').show();
                       
                    }else{
                        $('#tableresult td:nth-child('+ k  +'),th:nth-child('+ k+')').hide();
            
                    }
                                       
                }); 
            }                      
        }
    }
}(jQuery));
            
           